import { fire } from "./shooting/fire.js";
import { currentRole } from "../index.js";
import { move } from "./move.js";
export var setKey = function (key) {
    scheduler[key] || (scheduler[key] = "down");
};
export var removeKey = function (key) {
    scheduler[key] && delete scheduler[key];
};
var scheduler = {};
//指令动作
var actions = function () {
    var keys = Object.keys(scheduler);
    keys.forEach(function (k) {
        //判断移动的位置是否是边界
        switch (k) {
            case "a":
            case "d":
            case "w":
            case "s":
                move(k);
                break;
            case "j":
                fire(currentRole);
                break;
        }
    });
    requestAnimationFrame(actions);
};
requestAnimationFrame(actions);
